Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

477
Vistas
Audio not playing on IOS: [native code]:1 Unhandled Promise Rejection: NotSupportedError: The operation is not supported

Operating System: Windows to Apple iOS
Device: PC to iPhone 6, iPhone XS, iPhone XR, iPhone 11, iPhone 6S
Browser: Safari, Google Chrome
Errors: [native code]:1 Unhandled Promise Rejection: NotSupportedError: The operation is not supported.
[native code]:1 Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

Code:

let started = false;
let audio = new Audio();
audio.src = "data:audio/mpeg;base64,SUQzBAAAAAABEVRYWFgAAAAtAAADY29tbWVudABCaWdTb3VuZEJhbmsuY29tIC8gTGFTb25vdGhlcXVlLm9yZwBURU5DAAAAHQAAA1N3aXRjaCBQbHVzIMKpIE5DSCBTb2Z0d2FyZQBUSVQyAAAABgAAAzIyMzUAVFNTRQAAAA8AAANMYXZmNTcuODMuMTAwAAAAAAAAAAAAAAD/80DEAAAAA0gAAAAATEFNRTMuMTAwVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/zQsRbAAADSAAAAABVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/zQMSkAAADSAAAAABVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV";

...

class FrequencyData {
    constructor() {
        this.audioContext = null;
        this.source = null;
        this.analyser = null;
    }

    getFrequencies() {
        if (!this.audioContext) {
            this.audioContext = new window.AudioContext();
            this.source = this.audioContext.createMediaElementSource(audio);
            this.analyser = this.audioContext.createAnalyser();
        }

        this.source.connect(this.analyser);
        this.analyser.connect(this.audioContext.destination);

        return [new Uint8Array(this.analyser.frequencyBinCount), this.analyser];
    }
}

let frequencyData = new FrequencyData();

window.addEventListener("touchstart", function() { // Allows for audio to be played without needing user interaction every time.
    if (!started) {
        audio.play();
        started = true;
    }
});

...

webSocket.onmessage = function(event) {
        let message = event.data;
        audio.src = "";

        ...

        audio.src = "data:audio/mp3;base64," + message;
        audio.play();
        render();

        ...


The errors occur at the same time. I tested them on my iPhone and on hosted iPhones on browserstack so I could view the developer console. The audio is being sent through a websocket being hosted on my PC and is sent to the client which are the phones. It worked while testing it on other PCs. The audio is being sent as a base64 string and are mp3 files.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda